package com.dongdong.bookstore.data;

import com.dongdong.bookstore.module.ums.model.Resource;
import com.dongdong.bookstore.security.model.CustomUser;
import com.dongdong.bookstore.security.model.CustomUserDetails;
import com.dongdong.bookstore.security.model.UserCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

/**
 * 测试用户数据
 *
 * @author chiangkai
 * @date 2021-10-19
 * @email chiangkk@163.com
 */
@Component
public class UserData {

    public static CustomUserDetails user1() {
        CustomUser user = new CustomUser(1L, "小明", "$2a$10$DKae/WvNv0gXTjpEvLnqcuOg6E4/FkyqFq1Qa2azjdEN1d38nU4Tq", 1, UserCategory.ADMIN);
        ArrayList<Resource> resources = new ArrayList<>();
        return new CustomUserDetails(user, resources);
    }


}
